﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

namespace Akronus.TaskScheduler
{
    /// <summary>
    /// The base class for tasks.
    /// </summary>
    public abstract class TaskBase:ITask
    {
        /// <summary>
        /// Gets or sets the application URL.
        /// </summary>
        /// <value>The application URL.</value>
        public string ApplicationUrl { get; set; }

        /// <summary>
        /// Gets or sets the name of the task.
        /// </summary>
        /// <value>The name.</value>
        public string Name { get; set; }

        /// <summary>
        /// Gets or sets the status. For available statuses check the <see cref="TaskInfoTypes"/> class.
        /// </summary>
        /// <value>The status.</value>
        public string Status { get; set; }

        public ITaskLog TaskLog { get; set; }

        public ITaskInfoDataService DataService { get; set; }

        /// <summary>
        /// Gets or sets the configuration.
        /// </summary>
        /// <value>The configuration.</value>
        public XmlNode Configuration { get; set; }

        /// <summary>
        /// Executes the task.
        /// </summary>
        public abstract void Execute();

        /// <summary>
        /// Reads configuration.
        /// </summary>
        public abstract void Initialize();
    }
}
